// The Vue build version to load with the `import` command
// (runtime-only or standalone) has been set in webpack.base.conf with an alias.
import Vue from 'vue'
import App from './App'
import global_ from './components/Global'
import api from './api'
import router from './router'
import VueAwesomeSwiper from 'vue-awesome-swiper'

// require styles
import 'swiper/dist/css/swiper.css'

Vue.use(VueAwesomeSwiper)

Vue.prototype.GLOBAL = global_
Vue.prototype.$http = api

Vue.config.productionTip = false

// require('./mock')
/* eslint-disable no-new */
new Vue({
  el: '#app',
  router,
  components: { App },
  template: '<App/>'
})

// router.beforeEach((to, from, next) => {
//   if (to.path === '/') {
//     return next()
//   }
//   if (global_.player.openId === '') {
//     next('/')
//   } else {
//     next()
//   }
// })
